<template>
	<view class="bgc">
		<view class="bgc-image">
			<!-- <image src="../../static/bj.png" mode=""></image> -->
		</view>
		<view class="bgc-top">
			<view class="" style="margin: 10rpx 5rpx;">
				<view class="bgc-top-image">
					<image src="../../static/xing.png" mode=""></image>
				</view>
				<view class="">
					选择心仪商品
				</view>
			</view>
			<view class="">
				<view class="">
					<u-icon name="arrow-rightward" color="#CBCBCB"></u-icon>
				</view>
				<view class="">
				</view>
			</view>
			<view class="">
				<view class="bgc-top-image">
					<image src="../../static/zhifu.png" mode=""></image>
				</view>
				<view class="">
					支付商品金额
				</view>
			</view>
			<view class="">
				<view class="">
					<u-icon name="arrow-rightward" color="#CBCBCB"></u-icon>
				</view>
				<view class="">
					
				</view>
			</view>
			<view class="">
				<view class="bgc-top-image">
					<image src="../../static/fanli.png" mode=""></image>
				</view>
				<view class="">
					补贴返利1%
				</view>
			</view>
		</view>
		
		
		<!-- <view class="bgc-center">
			<view class="center-image">
				<image style="border-radius: 10rpx;" src="../../cdn-imgs/cdn-imgs/app_icon/icon-1.jpg" mode=""></image>
			</view>
		</view> -->
		
		
		<view class="goods-box1" v-for="(item, index) in listFrom" :key="index" @tap="jump('/pages/goods/detail/index', { id: item.id })">
			<view style="display: flex;">
				<!-- <image v-if="isTag && detail.activity" class="tag-img" :src="tagPath[detail.activity.type]" mode=""></image> -->
				<image class="img-box" style="border-radius: 10rpx;" :src="item.image" mode=""></image>
				<view class="price-box">
					<view class="" style="line-height: 46rpx;">
						{{item.title}}
					</view>
					<text class="bgc-image1">
						30人团
					</text>
					<view class="" style="display: flex;justify-content: space-between;align-items: center;">
						<view class="" >
							<text style="color: #FF0000;">￥{{item.price}}</text>
							<text class="original">{{item.original_price}}</text>
						</view>
					</view>
					<!-- <view class="flex x-bc align-end">
						<view class="current">{{ detail.activity_type === 'groupon' ? detail.groupon_price : detail.price }}</view>
						<view class="sales miso-font">销量{{ detail.sales }}件</view>
					</view> -->
					<!-- <view class="x-f tag-box"> -->
						<!-- <view class="discount">新人礼</view>
						<view class="discount">满100减60</view> -->
					<!-- </view> -->
				</view>
			</view>
			<!-- <view class="tip one-t">{{ detail.subtitle }}</view> -->
			<!-- <view class="title more-t">{{ detail.title }}</view> -->
			
			
			
			<view class="" style="padding: 0 27rpx; background-color: #FFA77F; color: #fff; border-radius: 40rpx;margin-left: 30rpx; height: 60rpx; line-height: 60rpx;">
				去拼团
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				page: 1,
				listFrom: [],
				lastPage: '',
			}
		},
		onLoad() {
			this.getList()
		},
		onReachBottom() {
			if (this.page < this.lastPage) {
				this.page += 1;
				this.getList();
			}
		},
		methods: {
			getList () {
				this.$api('goods.seach',{
					team_num: 30,
					page: this.page
				}).then(res => {
					if(res.code == 1) {
						this.listFrom = res.data.data
						this.lastPage = res.data.last_page;
						console.log('this.lastPage',this.lastPage)
					}
				})
			},
			
			
			// 路由跳转
			jump(path, parmas) {
				this.$Router.push({
					path: path,
					query: parmas
				});
			}
		}
	}
</script>

<style lang="scss" scoped>
	.bgc {
		width: 100%;
		height: 100%;
		background-color: #FCFCFC;
		
		image {
			width: 100%;
			height: 100%;
		}
		
		.bgc-image {
			width: 100%;
			height: 406rpx;
			background-image: url('https://w-jinxiao.oss-cn-chengdu.aliyuncs.com/20210322/162ba6695f11d85ceb304f392845622.jpg
');
			background-repeat: no-repeat;   
			background-size: 100% 100%; 
		}
		
		.bgc-top {
			width: 80%;
			height: 120rpx;
			z-index: 900;
			display: flex;
			margin: -60rpx auto 0;
			align-items: center;
			border-radius: 20rpx;
			background-color: #FFFFFF;
			font-size: 22rpx;
			justify-content: space-around;
			box-shadow: 0px 3px 26px 0px rgba(0, 0, 0, 0.06);
			
			.bgc-top-image {
				width: 36rpx;
				height: 40rpx;
				margin: 10rpx auto;
			}
		}
		
		
		// .bgc-center {
		// 	width: 100%;
		// 	padding: 0 23rpx;
		// 	margin-top: 40rpx;
		// 	border-radius: 20rpx;
			
		// 	.center-image {
		// 		width: 180rpx;
		// 		height: 180rpx;
		// 		border-radius: 20rpx;
		// 	}
		// }
		
		.goods-box1 {
			width: 100%;
			display: flex;
			align-items: flex-end;
			justify-content: space-between;
			background: #fff;
			padding: 30rpx 23rpx 20rpx;
			margin-top: 40rpx;
			border-bottom: 1rpx solid #F8F8F8;
		
			.img-box {
				width: 180rpx;
				height: 180rpx;
				// overflow: hidden;
				// position: relative;
		
				// .tag-img {
				// 	position: absolute;
				// 	left: 0;
				// 	top: 0;
				// 	z-index: 2;
				// 	width: 80rpx;
				// 	height: 40rpx;
				// }
		
				.img {
					width: 100%;
					height: 100%;
				}
			}
		
			.tip {
				width: 346rpx;
				line-height: 56rpx;
				background: rgba(246, 242, 234, 1);
				font-size: 22rpx;
				font-family: PingFang SC;
				font-weight: 400;
				color: rgba(168, 112, 13, 1);
				padding: 0 20rpx;
			}
		
			.title {
				font-size: 24rpx;
				font-family: PingFang SC;
				font-weight: 500;
				line-height: 36rpx;
				height: 72rpx;
				margin: 20rpx 20rpx 10rpx;
			}
		
			.price-box {
				margin-left: 20rpx;
				
				.bgc-image1 {
					display: inline-block;
					border-radius: 20rpx;
					color: #FE5C03;
					font-size: 2rpx;
					margin: 10rpx 0;
					padding: 7rpx 22rpx;
					background-color: #FFEFE5;
				}
				// padding: 10rpx 20rpx 0;
				// width: 344rpx;
				// .sales {
				// 	font-size: 20rpx;
				// 	font-family: PingFang SC;
				// 	font-weight: 400;
				// 	color: rgba(153, 153, 153, 1);
				// 	line-height: 20rpx;
				// 	margin-bottom: 20rpx;
				// }
				// .current {
				// 	font-size: 30rpx;
				// 	font-weight: 500;
				// 	color: rgba(225, 33, 43, 1);
				// 	line-height: 30rpx;
				// 	margin-bottom: 20rpx;
				// 	&:before {
				// 		content: '￥';
				// 		font-size: 26rpx;
				// 	}
				// }
		
				.original {
					font-size: 22rpx;
					font-weight: 400;
					text-decoration: line-through;
					color: rgba(153, 153, 153, 1);
					margin-left: 14rpx;
					line-height: 22rpx;
					margin-bottom: 10rpx;
					&:before {
						content: '￥';
						font-size: 20rpx;
					}
				}
		
				.tag-box {
					.discount {
						line-height: 28rpx;
						border: 1rpx solid rgba(225, 33, 43, 1);
						border-radius: 8rpx;
						font-size: 18rpx;
						font-family: PingFang SC;
						font-weight: 500;
						color: rgba(225, 33, 43, 1);
						padding: 0 8rpx;
						margin-right: 10rpx;
					}
				}
			}
		}
	}
</style>
